Refactor workflow to DAG architecture with expanded testing, CI modernisation, and validated numerical equivalence#281
Conversation
- Renamed `CodeEntropy/levels/structual_analysis.py` -> `CodeEntropy/levels/dihedral_analysis.py` to more accuatly define what this Class does - Introduced a new class within the module `CodeEntropy/levels/neighbours.py`
- `VibrationalEntropy` class -> own dedicated file within `CodeEntropy/entropy/nodes/vibrational_entropy.py` - `ConformationalEntropy` class -> own dedicated file within `CodeEntropy/entropy/nodes/configurational_entropy.py` - `OrientationalEntropy` class -> own dedicated file within `CodeEntropy/entropy/nodes/orientational_entropy.py` - Created a placeholder for the new graph builder `CodeEntropy/entropy/entropy_graph.py`
…xecution of entropy calculations
…y.select_levels()`
…er than `LevelGraph`
- Arguments are added to the `output_file.json` - Provenance added to the `output_file.json` - Tidied output logging in the `output_file.json`
Implement regression framework with: - baseline JSON comparisons - automatic dataset download from filestore - .testdata cache - slow test markers - config-driven system tests - CI workflows for quick PR checks and weekly full regression This provides reproducible validation of scientific results across releases.
…ession: Run unit tests across all supported OS and Python versions, add quick regression suite to PRs with .testdata caching, and configure weekly workflow to run full regression including slow tests. Simplify docs builds to latest environment.
- Add badges for PR checks, daily tests, weekly regression, and weekly docs. - Remove obsolete workflow badges and align README with current CI setup.
- Replace black, flake8, and isort with Ruff for linting and formatting. - Update pre-commit configuration and dependencies, add Ruff config to pyproject.toml, and apply automatic fixes across the codebase.
…or handling: - Avoid double logging of exceptions by centralising traceback reporting in the CLI. - Runtime now raises clean errors while preserving original exception chaining.
- Add ResultsReporter progress context manager - Propagate optional progress sink through workflow orchestration - Add progress reporting for: - Conformational state construction (per group) - Frame processing stage (per frame) - Keep entropy graph execution silent due to fast runtime - Update runtime tests to reflect wrapped RuntimeError behavior
…tooling: - Add instructions for unit vs regression test suites - Document slow test markers and how to run them - Explain automatic regression dataset downloads via filestore - Add guidance for updating regression baselines - Update coding standards to use Ruff instead of Black/Flake8/isort - Document multi-OS and multi-Python CI workflows - Clarify developer setup and testing commands - Remove outdated tooling references
jimboid
left a comment
There was a problem hiding this comment.
This represents a significant milestone in the restructuring of the code base into a modern DAG based architecture. This brings significant simplifications to how the code is structured, eliminates the multi-nested and tangled concerns. This will serve as a launchpad to bring in a much more useful API, task-based parallelism whilst being truly extensible into the future. Well done with this, this is a significant step forward in managing the technical debt in this project and put it on a solid footing for future development and sustainability.
One suggestion if the code coverage is still failing is to let the step continue on fail, this way it will still let CI pass for testing purposes and will show the cached coverage on main when broken.
Add fail-on-error: false to the Coveralls GitHub Action so that coverage reporting issues do not fail otherwise successful builds.
Summary
This PR introduces a major architectural refactor that transitions CodeEntropy to a DAG-based execution model while preserving numerical behaviour. The refactor improves modularity, maintainability, and testability, and modernises the project’s testing, CI, and tooling infrastructure.
All systems and component-level contributions match the previous implementation within floating-point tolerance (maximum absolute difference 2.45e-08).
No breaking changes to user-facing behaviour are expected.
Motivation
The previous workflow was primarily procedural, which made it harder to reason about execution order, extend functionality, and test individual stages. Moving to a DAG model improves separation of concerns, enables clearer data flow, and provides a stronger foundation for future development while maintaining numerical equivalence.
Changes
DAG-based workflow architecture
Frame-level covariance computation
FrameCovarianceNodefor per-frame second-moment matrices.axes_manager.CLI and job-folder execution model
ResultsReporter improvements
groups: { "": { components: {...}, total: ... } }
Example output JSON.
Testing architecture overhaul
Regression dataset system
.testdata/.Quick vs slow regression separation
Developer and tooling improvements
--update-baselinesworkflow.CI/CD modernisation
Documentation pipeline
Logging and error handling improvements
Impact
Regression validation results
CodeEntropy Graph Implementation.xlsx
Entropy outputs from the refactored DAG workflow were compared against the previous implementation across all systems and component types. All values agree within floating-point tolerance.
Maximum absolute difference across all systems: 2.45e-08
This comparison confirms agreement across all individual contributions, not only group totals. Observed differences are consistent with expected floating-point variation introduced by consolidating numerical operations into NumPy.